<template>
    <view class="listBox">
        <view class="back_fff list">
            <view class="flex justify_content_between">
                <view class="type">{{ item.order_text }}</view>
                <view class="time">{{ item.createtime }}</view>
            </view>
            <view class="flex justify_content_between pt_24">
                <view class="round"></view>
               <view class="title">{{ item.trailer_address}}</view>
               </view>
               <view class="flex justify_content_between pt_24">
                   <view class="round" style="background: #3377ff"></view>
                   <view class="title">
                       <view class="address">{{item.user_location }}</view>
                       <view>
                           <text class="name">{{ item.consignee }}</text>
                           <text class="iphone">{{ item.mobile }}</text>
                       </view>
                   </view>
            </view>
            <view class="money pt_24">
                费用
                <text>￥{{ item.actual_price }}</text>
            </view>
            <view class="flex btn justify_content_end">
                <!-- <view class="cance">取消订单</view> -->
                <!-- <view class="buy" @click="buybtn(0)">立即付款</view> -->
                <!-- <view class="buy" @click="buybtn(2)">完成服务</view> -->
                <!-- <view class="buy" @click="inProgress">订单详情</view> -->
                <!-- <view class="buy" @click="evaluate">去评价</view> -->
                <!-- <view class="buy" @click="AfterSalesDetails">售后详情</view> -->
				<view class="cance" @click="q_order(item.id)" v-if="item.order_status==0">取消订单</view>
				<view class="cance" @click="y_q_order(item.id)" v-if="item.order_status==1&&item.rider_status==1">取消订单</view>
				<view class="buy" @click="buybtn(item.id,1)" v-if="item.order_status==0">立即付款</view>
				<view class="buy" @click="buybtn(item.id,2)" v-if="item.order_status==1&&item.rider_status==0">订单详情</view>
				<view class="buy" @click="buybtn(item.id,2)" v-if="item.order_status==1&&item.rider_status==4">订单详情</view>
				<view class="buy" @click="inProgress(item.id)" v-if="item.order_status==1&&item.rider_status==1">订单详情</view>
				<view class="buy" @click="inProgress(item.id)" v-if="item.order_status==1&&item.rider_status==2">订单详情</view>
				<view class="buy" @click="inProgress(item.id)" v-if="item.order_status==1&&item.rider_status==3">订单详情</view>
				<view class="buy" @click="user_wc(item.id)" v-if="item.rider_status==1||item.rider_status==2||item.rider_status==3">完成服务</view>
				<view class="buy" @click="evaluate(item.id)" v-if="item.order_status==1&&item.rider_status==4&&item.is_p==0">去评价</view>
            </view>
        </view>
    </view>
</template>
<script>
export default {
    name: 'order-item-lock',
    props: {
        item: {
            type: Object,
            default: () => {}
        }
    },
    data() {
        return {};
    },
    methods: {
		//未支付取消
		q_order(id){
			this.$.ajax(1, "POST", "users/q_order", {
					id:id,
				}, (res) => {
					if(res.code==200){
						this.$.ti_shi(res.msg)
						 setTimeout(()=>{
							 this.$emit('handleGetOrderList')
						 },1000)
						 
					}else{
						this.$.ti_shi(res.msg)
					}
				})
		},
		user_wc(id){
			this.$.ajax(1, "POST", "users/user_wc", {
					order_id:id,
				}, (res) => {
					if(res.code==200){
						this.$.ti_shi(res.msg)
						 setTimeout(()=>{
							 this.$emit('handleGetOrderList')
						 },1000)
						 
					}else{
						this.$.ti_shi(res.msg)
					}
				})
		},
		buybtn(id,t) {
		    uni.navigateTo({
		        url: '/pages/me/MyOrder/ServiceOrders?id=' + id+'&t='+t
		    });
		},
		//已支付取消
		y_q_order(id){
			uni.navigateTo({
			    url: '/pages/me/MyOrder/CarCancel?id=' + id
			});
		},
        evaluate(id) {
            uni.navigateTo({
                url: '/pages/me/MyOrder/evaluate?id=' + id
            });
        },
        AfterSalesDetails() {
            uni.navigateTo({
                url: '/pages/me/MyOrder/AfterSalesDetails'
            });
        },
		inProgress(id) {
			 uni.navigateTo({
				 url: '/pages/me/MyOrder/inProgress?id=' + id
			 });
		}
    }
};
</script>

<style scoped lang="scss">
.box {
    padding: 0 32rpx;
}
.tipbox {
    background: #f7f7f7;
    border-radius: 8rpx;
    color: #666b75;
    font-size: 28rpx;
    padding: 8rpx;
}
.tip {
    padding: 16rpx;
    border-radius: 8rpx;
}
.tipActive {
    background: white;
    color: #00091a;
    padding: 16rpx;
    border-radius: 8rpx;
}
.tab {
    color: #999ca3;
    font-size: 28rpx;
    margin: 19rpx;
}
.tabActive {
    color: #3377ff;
    font-size: 32rpx;
    margin: 19rpx;
    font-weight: bold;
}
.list {
    padding: 24rpx;
    border-radius: 24rpx;
    margin-top: 24rpx;
    .round {
        width: 16rpx;
        height: 16rpx;
        border-radius: 50%;
        background: #00091a;
        font-size: 28rpx;
        margin-top: 16rpx;
    }
    .type {
        color: #3377ff;
        font-weight: bold;
    }
    .time {
        color: #ccced1;
    }
    .title {
        width: 90%;
        color: #00091a;
        font-size: 32rpx;
        font-weight: bold;
    }
    .address {
        display: inline-block;
        white-space: nowrap;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .name {
        font-weight: normal;
        color: #333a47;
        margin-right: 24rpx;
    }
    .iphone {
        font-weight: normal;
        color: #999ca3;
    }
    .money {
        text-align: right;
        color: #666b75;
    }
    .money text {
        color: #ff6401;
        font-weight: bold;
        font-size: 32rpx;
    }
    .btn {
        text-align: right;
    }
    .cance {
        width: 160rpx;
        height: 68rpx;
        line-height: 68rpx;
        border-radius: 8rpx;
        color: #666b75;
        text-align: center;
        border: 2rpx solid #ccced1;
        margin-top: 24rpx;
    }
    .buy {
        width: 160rpx;
        height: 68rpx;
        line-height: 68rpx;
        border-radius: 8rpx;
        color: #ffffff;
        text-align: center;
        background: #3377ff;
        margin-left: 24rpx;
        margin-top: 24rpx;
    }
}
</style>
